package com.app.ytong.bean;


import com.alibaba.fastjson.annotation.JSONField;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Index;

@Entity(indexes = {@Index(value = "uno,uname", unique = true)})

public class TraderListData extends BasisBean {


    /**
     *   {
     *       "uid": "1485859414894497793",
     *       "aid": "2",
     *       "uno": "2006",
     *       "uname": "计价员00",
     *       "upwd": "B1AB1E892617F210425F658CF1D361B5489028C8771B56D845FE1C62C1FBC8B0",
     *       "usign": "1",
     *       "unum": 6,
     *       "cdno": "00"
     *     }
     */
    private static final long serialVersionUID = 1L;


    @JSONField(serialize = false)
    public static TraderListData getAdminInfo(){
        TraderListData userInfoBean = new TraderListData();
        userInfoBean.setUno(LoginBean.getInstance().getUno());
        userInfoBean.setUname( LoginBean.getInstance().getUname());
        return userInfoBean;
    }


    @JSONField(name = "uid")
    private String uid;
    @JSONField(name = "aid")
    private String aid;
    @JSONField(name = "uno")
    private String uno;
    @JSONField(name = "uname")
    private String uname;
    @JSONField(name = "upwd")
    private String upwd;
    @JSONField(name = "usign")
    private String usign;
    @JSONField(name = "unum")
    private int unum;
    @JSONField(name = "cdno")
    private String cdno;

    @JSONField(name = "ufs")
    private String ufs;


    @Generated(hash = 1220406501)
    public TraderListData(String uid, String aid, String uno, String uname, String upwd,
            String usign, int unum, String cdno, String ufs) {
        this.uid = uid;
        this.aid = aid;
        this.uno = uno;
        this.uname = uname;
        this.upwd = upwd;
        this.usign = usign;
        this.unum = unum;
        this.cdno = cdno;
        this.ufs = ufs;
    }

    @Generated(hash = 705160822)
    public TraderListData() {
    }



    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getAid() {
        return aid;
    }

    public void setAid(String aid) {
        this.aid = aid;
    }

    public String getUno() {
        return uno;
    }

    public void setUno(String uno) {
        this.uno = uno;
    }

    public String getUname() {
        return uname;
    }

    public void setUname(String uname) {
        this.uname = uname;
    }

    public String getUpwd() {
        return upwd;
    }

    public void setUpwd(String upwd) {
        this.upwd = upwd;
    }

    public String getUsign() {
        return usign;
    }

    public void setUsign(String usign) {
        this.usign = usign;
    }

    public int getUnum() {
        return unum;
    }

    public void setUnum(int unum) {
        this.unum = unum;
    }

    public String getCdno() {
        return cdno;
    }

    public void setCdno(String cdno) {
        this.cdno = cdno;
    }
    public String getUfs() {
        return ufs;
    }

    public void setUfs(String ufs) {
        this.ufs = ufs;
    }

    public boolean isJijiayuan(){
        boolean isJijiayuan =false;
            switch (getUfs()){
                case "2":
//                    typeName = "计重员";
                    isJijiayuan = false;
                    break;
                case "3":
//                    typeName = "计价员";
                    isJijiayuan = true;
                    break;
                case "4":
//                    typeName = "管理员";
                    isJijiayuan = true;
                    break;
            }
        return isJijiayuan;
    }

    public String getUfsName(){
        String typeName = "";
        switch (getUfs()){
            case "2":
                typeName = "计重员";
                break;
            case "3":
                typeName = "计价员";
                break;
            case "4":
                typeName = "管理员";
                break;
        }
        return typeName;
    }
}
